package com.framework.entity;

import com.framework.entity.base.BapBaseTimeEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Comment;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import java.util.UUID;

/**
 * @Description: 权限实体类
 * @Author: JamesYao
 * @DateTime: 2024/2/19 16:25
 */

@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Table(name = "menu")
public class Menu extends BapBaseTimeEntity{

    @Comment("名称")
    @Column(nullable = false,length = 32)
    @NotNull(message="名称不能为空")
    private String name;

    @Comment("父id")
    @Column(length = 128)
    private UUID pid;

    @Comment("标题")
    @Column(length = 32)
    private String title;

    @Comment("路径")
    @Column(nullable = false,length = 128)
    @NotNull(message="路径不能为空")
    private String path;

    @Comment("组成部分")
    @Column(nullable = false,length = 128)
    @NotNull(message="组成部分不能为空")
    private String component;

    @Comment("图标")
    @Column(nullable = false,length = 32)
    @NotNull(message="组成部分不能为空")
    private String icon;
}
